﻿<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>SuperMgr前端框架</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!--全局通用框架样式 begin-->
    <!-- 全局基本样式 -->
    <link href="../content/superui/min/css/superui.common.min.css" rel="stylesheet" />
    <!-- 全局主题样式 -->
    <link href="../content/superui/global/css/components.min.css" id="style_components" rel="stylesheet" />
    <link href="../content/superui/pages/layouts/css/themes/darkblue.min.css" rel="stylesheet" type="text/css" id="style_color" />

    <script src="../content/superui/min/js/superui.common.min.js"></script>

    <link href="../content/supermgr/css/common.css" rel="stylesheet" />
    <link href="../content/plugins/wizard/wizard.css" rel="stylesheet" />
    <script src="../content/supermgr/js/common.js"></script>
    <link href="../content/plugins/wdtree/tree.css" rel="stylesheet" />
    <script src="../content/plugins/wdtree/tree.js"></script>
    <!--全局通用框架样式 end-->
</head>
<body>
    <div class="page-container">
        <div class="page-content">
            <form id="form1">

 <script>
     var keyValue = $.fn.request('keyValue');
    var instanceId = "";
    var formId = "";
    $(function () {
        initControl();
    });
    //初始化控件
    function initControl() {
        //公司
        $("#F_OrganizeId").ComboBoxTree({
            url: "../content/supermgr/json/companydata.json",
            description: "==请选择==",
            height: "200px",
            allowSearch: true,
        }).bind("change", function () {
            var value = $(this).attr('data-value');
            //加载部门
            $("#F_DepartmentId").ComboBoxTree({
                url: "../content/supermgr/json/departmentdata.json",
                description: "==请选择==",
                allowSearch: true
            });
            //加载角色
            $("#F_RoleId").ComboBox({
                url: "../content/supermgr/json/roledata.json",
                id: "F_RoleId",
                text: "F_FullName",
                description: "==请选择==",
                allowSearch: true
            });
            //加载岗位
            $("#F_DutyId").ComboBox({
                url: "../content/supermgr/json/userroledata.json",
                id: "F_RoleId",
                text: "F_FullName",
                description: "==请选择==",
                allowSearch: true
            });
        });
        //部门
        $("#F_DepartmentId").ComboBoxTree({
            description: "==请选择==",
            height: "200px",
            allowSearch: true
        }).bind("change", function () {
            var value = $(this).attr('data-value');
            //加载职位
            $("#F_PostId").ComboBox({
                url: "../content/supermgr/json/workdata.json",
                id: "F_RoleId",
                text: "F_FullName",
                description: "==请选择==",
                allowSearch: true
            });
            ////加载主管
            //$("#F_ManagerId").ComboBox({
            //    url: "../../BaseManage/User/GetListJson?departmentId=" + value,
            //    id: "F_UserId",
            //    text: "F_RealName",
            //    title: "F_Account",
            //    description: "==请选择==",
            //    allowSearch: true
            //});
        });
        //岗位
        $("#F_DutyId").ComboBox({
            description: "==请选择==",
            height: "200px",
            allowSearch: true
        });
        //角色
        $("#F_RoleId").ComboBox({
            description: "==请选择==",
            height: "200px",
            allowSearch: true
        });
        //职位
        $("#F_PostId").ComboBox({
            description: "==请选择==",
            height: "200px",
            allowSearch: true
        });
        //主管
        $("#F_ManagerId").ComboBox({
            description: "==请选择==",
            height: "200px",
            allowSearch: true
        });
        //性别
        $("#F_Gender").ComboBox({
            description: "==请选择==",
        });
     
        //获取表单
        if (!!keyValue) {
            $.SetForm({
                url: "../content/supermgr/json/userformdata.json",
                param: { keyValue: keyValue },
                success: function (data) {
                    $("#form1").SetWebControls(data);
                    $("#F_OrganizeId").trigger("change");
                    $("#F_DepartmentId").ComboBoxTreeSetValue(data.F_DepartmentId).trigger("change");
                    $("#F_DutyId").ComboBoxSetValue(data.F_DutyId);
                    $("#F_RoleId").ComboBoxSetValue(data.F_RoleId);
                    $("#F_PostId").ComboBoxSetValue(data.F_PostId);
                    $("#F_ManagerId").ComboBoxSetValue(data.F_ManagerId);
                    $("#F_Birthday").val(formatDate(data.F_Birthday, "yyyy-MM-dd"));
                    $("#F_Password").val("******").attr('disabled', 'disabled');
                }
            });
        }
    }
    //保存表单
    function AcceptClick() {
        if (!$('#form1').Validform()) {
            return false;
        }
        var postData = $("#form1").GetWebControls(keyValue);
        postData["F_DutyName"] = $("#F_DutyId").attr('data-text');
        postData["F_PostName"] = $("#F_PostId").attr('data-text');
        postData["F_Manager"] = $("#F_ManagerId").attr('data-text');
        var _instanceData = $("#frmpreview").frmGetData();
        var moduleFormInstanceEntity = { "F_FormId": formId, "F_FormInstanceJson": JSON.stringify(_instanceData) };

        $.SaveForm({
            url: "../../BaseManage/User/SaveForm",
            param: { "keyValue": keyValue, "strUserEntity": JSON.stringify(postData), "FormInstanceId": instanceId, "strModuleFormInstanceEntity": JSON.stringify(moduleFormInstanceEntity) },
            loading: "正在保存数据...",
            success: function (data) {
                $.currentIframe().$("#gridTable").trigger("reloadGrid");
            }
        })
    }
 </script>
                <div style="margin-left: 10px; margin-right: 10px; padding-top: 10px;padding-bottom: 10px">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#BaseInfo" data-toggle="tab">基本信息</a></li>
                        <li><a href="#ExpandInfo" data-toggle="tab">扩展属性</a></li>
                    </ul>
                    <div class="tab-content" style="padding-top: 15px;">
                        <div id="BaseInfo" class="tab-pane active" style=" padding-right 30px;">
                            <table class="form">
                                <tr>
                                    <td class="formTitle">账户<font face="宋体">*</font></td>
                                    <td class="formValue">
                                        <input id="F_Account" type="text" onblur="$.fn.existField(this.id,'../../BaseManage/User/ExistAccount')" class="form-control" placeholder="请输入账户" isvalid="yes" checkexpession="NotNull" />
                                    </td>
                                    <td class="formTitle">密码<font face="宋体">*</font></td>
                                    <td class="formValue">
                                        <input id="F_Password" type="text" class="form-control" placeholder="请输入密码" isvalid="yes" checkexpession="NotNull" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">公司<font face="宋体">*</font></td>
                                    <td class="formValue">
                                        <div id="F_OrganizeId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
                                    </td>
                                    <td class="formTitle">部门<font face="宋体">*</font></td>
                                    <td class="formValue">
                                        <div id="F_DepartmentId" type="selectTree" class="ui-select" isvalid="yes" checkexpession="NotNull"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">岗位</td>
                                    <td class="formValue">
                                        <div id="F_DutyId" type="select" class="ui-select"></div>
                                    </td>
                                    <td class="formTitle">职位</td>
                                    <td class="formValue">
                                        <div id="F_PostId" type="select" class="ui-select"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">角色</td>
                                    <td class="formValue">
                                        <div id="F_RoleId" type="select" class="ui-select"></div>
                                    </td>
                                    <td class="formTitle">主管</td>
                                    <td class="formValue">
                                        <div id="F_ManagerId" type="select" class="ui-select"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">工号</td>
                                    <td class="formValue">
                                        <input id="F_EnCode" type="text" class="form-control" />
                                    </td>
                                    <td class="formTitle">姓名</td>
                                    <td class="formValue">
                                        <input id="F_RealName" type="text" class="form-control" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">性别</td>
                                    <td class="formValue">
                                        <div id="F_Gender" type="select" class="ui-select">
                                            <ul>
                                                <li data-value="1">男</li>
                                                <li data-value="0">女</li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td class="formTitle">生日</td>
                                    <td class="formValue">
                                        <input id="F_Birthday" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">手机</td>
                                    <td class="formValue">
                                        <input id="F_Mobile" type="text" class="form-control" />
                                    </td>
                                    <td class="formTitle">电话</td>
                                    <td class="formValue">
                                        <input id="F_Telephone" type="text" class="form-control" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">邮箱</td>
                                    <td class="formValue">
                                        <input id="F_Email" type="text" class="form-control" />
                                    </td>

                                    <td class="formTitle">微信</td>
                                    <td class="formValue">
                                        <input id="F_WeChat" type="text" class="form-control" />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="formTitle">QQ</td>
                                    <td class="formValue">
                                        <input id="F_OICQ" type="text" class="form-control" />
                                    </td>
                                    <td class="formTitle">MSN</td>
                                    <td class="formValue">
                                        <input id="" type="text" class="form-control" />
                                    </td>
                                </tr>
                               
                            </table>
                        </div>
                        <div id="ExpandInfo" class="tab-pane" style="height:400px;overflow:auto;">
                            <!--<div class="app_layout app_preview" style="border-top: 1px solid #ccc;" id="frmpreview"></div>-->
                            其他
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>
</body>
<!--[if lt IE 9]>
    <script src="../content/superui/base/base-core/excanvas.min.js"></script>
    <script src="../content/superui/base/base-core/respond.min.js"></script>
<![endif]-->
<!-- 全局公共类库Begin -->

</html>

<script src="../content/plugins/wizard/wizard.js"></script>
